package com.ztgf.sys.service;

import org.apache.dubbo.config.annotation.DubboService;
import org.apache.ibatis.plugin.Intercepts;
import org.springframework.beans.BeanUtils;
import javax.annotation.Resource;
import com.ztgf.sys.common.config.YmlConfig;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.ztgf.sys.mapper.SysApiLogMapper;
import com.ztgf.sys.models.service.ISysApiLogService;
import com.ztgf.sys.models.bo.SysApiLogSaveBO;
import com.ztgf.sys.models.dto.SysApiLogDTO;

/**
 * 接口访问日志表控制器
 *
 * @author zhanghualang
 * @Date 2020-07-02 11:45:35
 */
@DubboService
public class SysApiLogServiceImpl extends ServiceImpl<SysApiLogMapper, SysApiLogDTO> implements ISysApiLogService{

    @Resource
    private YmlConfig ymlConfig;

    @Override
    public boolean add(SysApiLogSaveBO saveBO) {
        SysApiLogDTO dto = new SysApiLogDTO();
        BeanUtils.copyProperties(saveBO,dto);
        Long id = ymlConfig.getPkId();
        dto.setId(id);
        return this.insert(dto);
    }
}
